<h1>Cargar Estadisticas</h1>
<table id="list-carga" class="ui-widget ui-widget-content table-content">
    <thead>
        <tr class="ui-widget-header ">
            <th>Municipio</th>
            <th>Población electoral</th>
            <th>Población PSUV</th>
            <th>Patrullas 1x10</th>
            <th>Votos</th>
            <th>Votos Chávez</th>
            <th>Votos Oposición</th>
            <th>Abstención</th>
        </tr>
    </thead>
    <tbody><?php
$totalElectores = 0;
$totalPSUV = 0;
$totalPatrulleros = 0;
$votos = 0;
$votos_chavez = 0;
$abstencion=0;
foreach ($this->singleList as $key => $value) {
   ?>
        <tr>
            <td><?php print '<div ref="' . $value['cod_municipio'] . '" class="styleLink municipio close">' . $value['municipio'] . '</div></td>'; ?></td>
            <td><?php $totalElectores = $totalElectores + $value['electores'];
        print $value['electores'];
   ?></td>
            <td><?php $totalPSUV = $totalPSUV + $value['electores_PSUV'];
                print $value['electores_PSUV'];
                ?></td>
            <td><?php $totalPatrulleros = $totalPatrulleros + $value['electores_patrulleros'];
                print $value['electores_patrulleros'];
   ?></td>
            <td><?php $votos = $votos + $value['votos'];
                print $value['votos'];
                ?></td>
            <td><?php $votos_chavez = $votos_chavez + $value['votos_chavez'];
                print $value['votos_chavez'];
   ?></td>
            <td><?php print $value['votos'] - $value['votos_chavez']; ?></td>
            <td><?php $abstencion = $abstencion + ($value['electores'] - $value['votos']);
        print $value['electores'] - $value['votos']; ?></td>
        </tr>
        
    <?php
}
?>
    <tfoot>
        <tr>
            <td>TOTALES</td>
            <td><?php print $totalElectores; ?></td>
            <td><?php print $totalPSUV; ?></td>
            <td><?php print $totalPatrulleros; ?></td>
            <td><?php print $votos; ?></td>
            <td><?php print $votos_chavez; ?></td>
            <td><?php print $votos - $votos_chavez; ?></td>
            <td><?php print $abstencion; ?></td>

        </tr>
    </tfoot>
</tbody>
</table>